home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 16
/
CU Amiga Magazine's Super CD-ROM 16 (1997-10-16)(EMAP Images)(GB)[!][issue 1997-11].iso
/
CUCD
/
Utilities
/
moreHTML
/
Source
/
mystring.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-11
|
592b
|
49 lines
// MyString
// © Dirk Holtwick, 1997
/// Includes
#include <clib/alib_protos.h>
#include <proto/exec.h>
#include <exec/memory.h>
#include <string.h>
///
/// Example
/*
char *s;
s = MyAllocString("Hallo");
MyFreeString(s);
*/
///
/// MyAllocString
char *MyAllocString(register char *str)
{
register char *h;
if(str)
{
if(h = AllocVec(strlen(str)+1, 0))
{
strcpy(h, str);
return(h);
}
}
return(0);
}
///
/// MyFreeString
char *MyFreeString(register char *str)
{
if(str)
{
FreeVec(str);
}
return(NULL);
}
///